<template>
  <!--  选择角色公共组件-->
  <div class="roleSel">
    <el-select v-model="modelValue" placeholder="请选择" @change="change">
      <el-option v-for="item in roleOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option>
    </el-select>
  </div>
</template>
<script>
import { getRolePage } from '@/api/modular/system/roleManage'

export default {
  data() {
    return {
      roleOptions: []
    }
  },
  props: ['modelValue'],
  created() {
    getRolePage({ pageNo: 1, pageSize: 999 }).then(res => (this.roleOptions = res.data.rows))
  },
  methods: {
    change(val) {
      this.$emit('update:modelValue', val)
    }
  }
}
</script>

<style scoped lang="scss"></style>
